import {
	baseUrl
} from "./base.js"
import {
	GetStroage
} from "@/utils/tool.js"
export const myRequest = ((option) => {
	return new Promise((resolve, reject) => {
		// console.log("请求的url地址:", baseUrl, option.url);
		uni.request({
			url: baseUrl + option.url,
			method: option.method || "GET",
			data: option.data || {},
			header: {
				Authorization: "Bearer" + GetStroage("token"),
				"Content-Type": "application/json"
			},
			success: (res) => {
				console.log("封装的request", res);
				resolve(res);
			},
			fail: (err) => {
				console.log("封装的request", err);
				reject(err);
			}
		})
	})
})
